﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace SecurityApi.SoapApi
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract]
    public interface ISecurityService
    {
        [OperationContract]
        List<SecurityApi.Model.Application> GetUserApplicationsByName(string userName, int enterpriseId);

        [OperationContract]
        SecurityApi.Model.Application GetUserApplicationsById(int id);

        [OperationContract]
        bool VerifyUser(string userName, string password, int enterpriseId);

        [OperationContract]
        bool VerifyEnterpriseUser(string userName, string password, string enterpriseName);

        [OperationContract]
        SecurityApi.Model.EnterpriseUser GetEnterpriseUser(string userName, int enterpriseId);

        [OperationContract]
        List<SecurityApi.Model.EnterpriseUser> GetEnterpriseUsers(int enterpriseId);


        #region Roles
        [OperationContract]
        List<SecurityApi.Model.Role> GetApplicationRoles(int applicationId);

        [OperationContract]
        List<SecurityApi.Model.Role> GetUserRoles(string userName, int applicationId);

        [OperationContract]
        List<SecurityApi.Model.Role> GetUserRolesInEnterprise(int userId, int enterpriseId);


        #endregion


        #region enterprise attribute
        //TODO: Add API to add/update/delete attributes
        [OperationContract]
        string GetEnterpriseAttribute(int enterpriseId, string key);
        #endregion


        #region Application attribute
        //TODO: Add API to add/update/delete attributes
        [OperationContract]
        string GetApplicationAttribute(int applicationId, string key);
        #endregion

    }

}
